package gui;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.SwingConstants;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class Usuario_buscar extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JButton btnBuscar;
	private JTable table;
	private JButton btnSalir;
	private JScrollPane scrollPane;
	private JPanel panel;
	private Button btnExaminar;
	private Button btnEditar;
	private JTextField txtTotalDeRegistros;
	private JTextField textField_1;

	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Usuario_buscar frame = new Usuario_buscar();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Usuario_buscar(Principal padre){
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e){
				padre.nullUsuarioBuscar();
			}
		});
		setTitle("Buscar Usuario");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(175, 175, 450, 432);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblClave = new JLabel("Clave:");
		lblClave.setBounds(10, 11, 75, 14);
		contentPane.add(lblClave);
		
		textField = new JTextField();
		textField.setBounds(95, 8, 230, 20);
		contentPane.add(textField);
		textField.setColumns(10);
		
		btnBuscar = new JButton("Buscar");
		btnBuscar.setBounds(335, 7, 89, 23);
		contentPane.add(btnBuscar);
		
		panel = new JPanel();
		panel.setBounds(10, 42, 414, 307);
		contentPane.add(panel);
		panel.setLayout(null);
		
		scrollPane = new JScrollPane();
		scrollPane.setBounds(0, 0, 414, 283);
		panel.add(scrollPane);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"Nombre", "Apellido", "Perfil", "Telefono"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		table.getColumnModel().getColumn(0).setResizable(false);
		table.getColumnModel().getColumn(1).setResizable(false);
		table.getColumnModel().getColumn(2).setResizable(false);
		table.getColumnModel().getColumn(3).setResizable(false);
		
		btnEditar = new Button("Editar");
		btnEditar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		btnEditar.setBounds(115, 283, 115, 23);
		panel.add(btnEditar);
		
		btnExaminar = new Button("Examinar");
		btnExaminar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		btnExaminar.setBounds(0, 283, 115, 23);
		panel.add(btnExaminar);
		
		txtTotalDeRegistros = new JTextField();
		txtTotalDeRegistros.setEditable(false);
		txtTotalDeRegistros.setHorizontalAlignment(SwingConstants.RIGHT);
		txtTotalDeRegistros.setText("Total de Registros:");
		txtTotalDeRegistros.setBounds(229, 283, 141, 24);
		panel.add(txtTotalDeRegistros);
		txtTotalDeRegistros.setColumns(10);
		
		textField_1 = new JTextField();
		textField_1.setBounds(370, 283, 44, 24);
		panel.add(textField_1);
		textField_1.setColumns(10);
		
		btnSalir = new JButton("Salir");
		btnSalir.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				padre.nullUsuarioBuscar();
				dispose();				
			}
		});
		btnSalir.setBounds(335, 360, 89, 23);
		contentPane.add(btnSalir);
	}
}